<%@page pageEncoding="UTF-8" contentType="text/html"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Phone book</title>
    </head>
    <body>
        <f:view>
        <h:form>
            Name: <h:inputText value="#{PhonebookAgent.name}" />
            Phone number: <h:inputText value="#{PhonebookAgent.phoneNumber}" />
            <h:commandButton value="Create" action="#{PhonebookAgent.create}" />       
        </h:form>
        <HR>
        <h:dataTable value="#{PhonebookAgent.subscribers}" var="subscriber" border="1">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Name" />
                </f:facet>
                <h:outputText value="#{subscriber.name}" />
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Phone number" />
                </f:facet>
                <h:outputText value="#{subscriber.phoneNumber}" />
            </h:column>
        </h:dataTable>
        </f:view>    
    </body>
</html>
